import React, { Component } from "react";
import {
  HashRouter as Router,
  Route,
  Switch,
  Redirect,
} from "react-router-dom";
import Index from "./components/index/Index";
import Cart from "./components/cart/Cart";
import My from "./components/my/My";
import Category from "./components/category/Category";
import Tabbar from "./components/tabbar/Tabbar";
import SearchCenter from "./components/searchCenter/SearchCenter";
import GoodsDetail from "./components/goodDetail/GoodsDetail";
export default class RouterConfig extends Component {
  render() {
    return (
      <Router>
        <Route
          path="/"
          exact
          render={() => (
            <Tabbar>
              <Index></Index>
            </Tabbar>
          )}
        ></Route>
        <Route
          path="/cart"
          exact
          render={() => (
            <Tabbar>
              <Cart></Cart>
            </Tabbar>
          )}
        ></Route>
        <Route
          path="/my"
          exact
          render={() => (
            <Tabbar>
              <My></My>
            </Tabbar>
          )}
        ></Route>
        <Route
          path="/category"
          exact
          render={() => (
            <Tabbar>
              <Category></Category>
            </Tabbar>
          )}
        ></Route>
        <Route
          path="/searchCenter"
          exact
          render={() => <SearchCenter />}
        ></Route>
        <Route
          path="/goodsDetail/:goods_id"
          exact
          render={(props) => <GoodsDetail {...props} />}
        ></Route>
      </Router>
    );
  }
}
